import * as React from 'react'
import classNames from 'classnames'
import Fields from './fields'

import { QuoteProps, QuoteState } from './interface'

class Quote extends React.Component<QuoteProps, QuoteState> {
  static Fields: typeof Fields
  static defaultProps = {
    prefixCls: 'layui-elem-quote'
  }
  constructor(props: QuoteProps) {
    super(props)
    this.state = {}
  }

  render() {
    const {
      prefixCls, children, className,
      type,
      ...restProps
    } = this.props

    const classes = classNames(prefixCls, className, {
      [`${prefixCls}-${type}`]: type
    })

    return (
      <blockquote
        className={classes}
        {...restProps}
      >
        {children}
      </blockquote>
    )
  }

}

export default Quote